package dao;

import entity.Item;
import entity.Orders;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * @version 1.0
 * @Author: xxf
 * @CreateDate: 2020/10/7 19:26
 */
public interface OrderDao {
    /**
     * 添加订单
     * @param orders
     */
    void addOrders(Orders orders);

    /**
     * 添加订单项
     * @param items
     */
    void addItems(List<Item> items);

    /**
     * 查询订单集合
     * @param uid
     * @return
     */
    List<Orders> findOrdersByUid(int uid) throws InvocationTargetException, IllegalAccessException;

    /**
     * 通过oid查询订单对象
     * @param oid
     * @return
     */
    Orders findOrdersByOid(String oid) throws InvocationTargetException, IllegalAccessException;

    /**
     * 通过oid查询订单项集合
     * @param oid
     * @return
     */
    List<Item> findItemsByOid(String oid) throws InvocationTargetException, IllegalAccessException;

    /**
     * 修改订单支付状态
     * @param oid
     */
    void updateOrderStateByOid(String oid);
}
